{% extends "base.html" %}

{% block title %}
        监控配置
{% endblock %}

{% block content %}

<style>
        .table th, .table td {vertical-align:middle;}
</style>

<script type="text/javascript">
        function do_reset(url){
               if (confirm("确定执行么？"))
               {
                       window.location.href=url;
               }
        }
</script>

<div class="alert alert-info">
	<h2>选择要配置的监控项目</h2>
</div>

<!--
<div style="float:right; width:80px; margin-bottom: 20px;">
	<button class="btn btn-block btn-primary" type="button" onclick="window.location.href='/project/add/'">添加</button>
</div>
-->

<div>
<p>
	<table class="table table-bordered table-striped table-hover">
	<tr>
	<th>监控项目</th>
	<th style="width:100px;">项目别名</th>
        <th style="width:100px;">执行方式</th>
	<th>调用命令</th>
	<th>使用帮助</th>
	<th colspan=2>操作</th>
	</tr>
{% load key %}
{% for monitor in result %}
	<tr>
	<td>{{ monitor|key:'monitorname' }}</td>
	<td>{{ monitor|key:'monitoralias' }}</td>
	<td>{{ monitor|key:'monitortype' }}</td>
	<td>{{ monitor|key:'monitorcmd' }}</td>
	<td>{{ monitor|key:'monitorhelp' }}</td>
	<td><button class="btn btn-block" type="button" onclick="window.location.href='/monitor/conf/edit/?monitor={{ monitor|key:'monitorname' }}'" style="width:100px;">编辑</button></td>
	<td><button class="btn btn-block btn-danger" type="button" onclick="window.location.href='javascript:do_reset(\'/monitor/conf/del/?monitor={{ monitor|key:'monitorname' }}\')'" style="width:100px;">删除</button></td>
	</tr>

{% endfor %}
	<tr>
		<td colspan=6></td>
		<td colspan=2><button class="btn btn-block btn-primary" type="button" onclick="window.location.href='/monitor/conf/add/'">添加项目</button></td>
	</tr>
	</table>
</p>
{% endblock %}
